﻿@using Classified.Data.Enums
@model Classified.Domain.Entities.ClassifiedCategoryAttribute
@using (Html.BeginForm("EditAttributes", "Classified"))
{
    <fieldset>
        @Html.HiddenFor(x=>x.Id)
        <div class="clearfix">
            <label>
                category :</label>
            <div class="input chzn-select">
                @Html.DropDownList("CategoryId")
            </div>
        </div>
        <div class="clearfix">
            @Html.LabelFor(model => model.Attr_Label)
            <div class="input long">
                @Html.EditorFor(model => model.Attr_Label)
                @Html.ValidationMessageFor(model => model.Attr_Label)
            </div>
        </div>
        <div class="clearfix">
            @Html.LabelFor(model => model.Attr_Name)
            <div class="input long">
                @Html.EditorFor(model => model.Attr_Name)
                @Html.ValidationMessageFor(model => model.Attr_Name)
            </div>
        </div>
        <div class="clearfix">
            @Html.LabelFor(model => model.AttributeControlTypeId)
            <div class="input long">
                @Html.DropDownListFor(model => model.AttributeControlTypeId, Enum.GetValues(typeof(AttributeControlType)).Cast<AttributeControlType>().Select(x => new SelectListItem { Text = x.ToString(), Value = ((int)x).ToString() }))
                @Html.ValidationMessageFor(model => model.AttributeControlTypeId)
            </div>
        </div>
        <div class="clearfix">
            @Html.LabelFor(model => model.AttributesSearchBy)
            <div class="input long">
                @Html.DropDownListFor(model => model.AttributesSearchBy, Enum.GetValues(typeof(AttributeSearchBy)).Cast<AttributeSearchBy>().Select(x => new SelectListItem { Text = x.ToString(), Value = ((int)x).ToString() }))
                @Html.ValidationMessageFor(model => model.AttributesSearchBy)
            </div>
        </div>
        <div class="actions">
            <input type="submit" value="Save" class="btn" />
               <input type="button" class="btn closeModal" value="Close Window" />
        </div>
    </fieldset>
}
 <script type="text/javascript">
     $(document).ready(function () {
         $("div.chzn-select select").chosen({ width: '600px' });
         $(".chzn-select-deselect").chosen({ allow_single_deselect: true });
     });
    </script>